﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Inheritance
{
    class Program
    {
        static void Main(string[] args)
        {
            List<Animal> animals = new List<Animal>();

            animals.Add(new Animal("Крокодил",AnimalSex.Male,2));
            animals.Add(new Fish("Иваси", AnimalSex.Male, 2,4));
            animals.Add(new Mammal("Обезьяна", AnimalSex.Female, 34, 10));
            animals.Add(new Mammal("Обезьяна", AnimalSex.Female, 34, 10));
            animals.Add(new Bird("Пингвин",AnimalSex.Female,2,10));


            //foreach (Animal a in animals)
            //{
            //    a.PrintInfoToConsole();
            //}


            Console.WriteLine("Кто ты????");
            Console.WriteLine("1. Ребёнок");
            Console.WriteLine("2. Взрослый");
            Console.WriteLine("3. Пенс");
            Console.WriteLine("4. Я не знаю");

            Visitor v = null;

            ConsoleKeyInfo k =  Console.ReadKey();
            switch (k.Key)
            {
                case ConsoleKey.D1:
                case ConsoleKey.NumPad1:
                    v = new Child();
                    break;
                case ConsoleKey.D2:
                case ConsoleKey.NumPad2:
                    v = new Adult();
                    break;
                case ConsoleKey.D3:
                case ConsoleKey.NumPad3:
                    v = new Pensioneer();
                    break;
                default:
                    Console.WriteLine("Go home");
                    break;
            }
            Console.WriteLine("Your entrance fee is {0}", v.TicketPrice);


            Console.ReadKey();

        }
    }
}
